/**
 * 
 */
package org.xelnaga.defiler.web.controller.filed;

import java.util.ArrayList;
import java.util.List;

import org.xelnaga.defiler.domain.FieldModel.FieldTypeEnum;

/**
 * @author qijb
 *
 */
public class FieldTypeClass {
	int x;
	String displayName = "";
	String id;
	String label;
	String imageUrl;
	String[] show;
	String dataType;
	String helpText;
	/**
	 * 
	 */
	public FieldTypeClass(FieldTypeEnum type) {
		if(null != type) {
			this.x = type.getX();
			this.dataType = type.getDataType();
			this.displayName = type.getDisplayName();
			this.helpText = type.getHelpText();
			this.id = type.getId();
			this.imageUrl = type.getImageUrl();
			this.label = type.getLabel();
			this.show = type.getShow();
		}
	}
	public int getX() {
		return x;
	}
	public void setX(int x) {
		this.x = x;
	}
	public String getDisplayName() {
		return displayName;
	}
	public void setDisplayName(String displayName) {
		this.displayName = displayName;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getLabel() {
		return label;
	}
	public void setLabel(String label) {
		this.label = label;
	}
	public String getImageUrl() {
		return imageUrl;
	}
	public void setImageUrl(String imageUrl) {
		this.imageUrl = imageUrl;
	}
	public String[] getShow() {
		return show;
	}
	public void setShow(String[] show) {
		this.show = show;
	}
	public String getDataType() {
		return dataType;
	}
	public void setDataType(String dataType) {
		this.dataType = dataType;
	}
	public String getHelpText() {
		return helpText;
	}
	public void setHelpText(String helpText) {
		this.helpText = helpText;
	}
	
	public static List<FieldTypeClass> getAllTypes(){
		List<FieldTypeClass> list = new ArrayList<FieldTypeClass>();
		FieldTypeEnum[] types = FieldTypeEnum.values();
		for(FieldTypeEnum type : types) {
			list.add(new FieldTypeClass(type));
		}
		return list;
	}
}
